import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../views/Main.vue';
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'mymain',
    component: Main
  },
  {
    path: '/goodslist',
    name: 'goodslist',
    component: ()=>import('../views/GoodsList.vue')
  },
  {
    path: '/goodsdetail',
    name: 'goodsdetail',
    component: ()=>import('../views/GoodsDetail.vue')
  },
  {
    path:'/buy',
    name:'buy',
    component:()=>import('../views/Buy.vue')
  },
  {
    path:'/login',
    name:'login',
    component:()=>import('../views/Login.vue')
  },
  {
    path:'/register',
    name:'register',
    component:()=>import('../views/Register.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
